Skip to content
This repository has been archived by the owner on Jun 23, 2024. It is now read-only.

Experimental support for use of expressions in custom variables #78

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wayne530
Copy link

@wayne530 wayne530 commented Aug 3, 2023

This is just a proof of concept to get a discussion started around the possibility of introducing support for expressions in custom variables. There are many different ways this could be implemented and I'm not tied to this specific implementation, but just wanted to get the convo started. @theofidry curious your thoughts on this? Has this been considered?

@wayne530
Copy link
Author

No joy?
Is this project still maintained? Looking for a new owner to take it over? :)

Copy link
Owner

@theofidry theofidry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I was away from OSS quite a while this year.

I think it's a good idea, and I admit I'm no longer using this bundle so I am happy to pass the torch for this project.


psysh:
variables:
foo: bar
router: "@router"
some: [thing, else]
debug: "%kernel.debug%"
doctrine: "{service('%containerId').get('doctrine')}"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't @=service('%containerId').get('doctrine') be enough here?

if (is_string($value)) {
if (strpos($value, '@') === 0) {
$value = new Reference(substr($value, 1));
} else if (strpos($value, '{') === 0) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned above I think if we are to introduce support for expressions we should we the "standard" expression? Or maybe I'm confusing with something else... Maybe OverblogGraphQLBundle YAML config

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants